package gameSocketer.socketParsers
{
	import com.adobe.serialization.json.JSON;
	
	import gameUi.panel.InfoPanel;
	
//	import gameUi.panel.InfoPanel;

	public class ChipSocketPaser extends SocketParserBase
	{
		public function ChipSocketPaser()
		{
			super();
		}
		
		override public function parseData(lengh:int=0):void{
			switch(launch.readByte()){
				case 1:
					trace("lengh",lengh);
					tempObj =com.adobe.serialization.json.JSON.decode(launch.readUTFBytes(lengh-2));
					
					BlackJack._gameUi.roleMoney =  tempObj.interation.toString();//账户余额
					BlackJack._gameUi.tittle.txtMoney.text = tempObj.chips.toString();//筹码余额
					var result:int = tempObj.result;
					
					switch(result){
						case 0://成功
							InfoPanel.getInstance().showInfo(3);
							break;
						case 1://积分不足
							InfoPanel.getInstance().showInfo(0);
							break;
						case 2://服务器繁忙
							InfoPanel.getInstance().showInfo(2);
							break;
					}
					break;
				case 2://断线
					InfoPanel.getInstance().showInfo(4);
					break;
			}
		}
	}
}